<?php
    include_once '../../../controlador/php/conexion/Conexion.php';
    $con = new Conexion();
    
    $Perfil = $_REQUEST['Perfil'];
    
    $diag = " SELECT usu_oid as OID,ltrim(rtrim(usu_nombres))+' '+ltrim(rtrim(usu_apellidos))as NOMBRES,
                     PerfilOid 
              FROM usuario AS A
              INNER JOIN Tf_UsuarioPerfil AS B ON A.usu_oid = B.UsuarioOid
              WHERE PerfilOid = ".$Perfil;
             //WHERE usu_tipoUsu NOT IN(61,74,97,102)";
    
    $lstd = $con->query($diag);
    $result=array();
    while($lst = mssql_fetch_array($lstd)){
        $result[] = $lst['OID']."-".$lst['NOMBRES'];
    }
    
    $result2 = $result; 
    
    $con->cerrarConexion();
    print_r(json_encode($result2));
?>
